var t = require("../export.js");

Page({
    data: {
        couponlist: [],
        card_show: !0,
        options: {}
    },
    onLoad: function(t) {
        this.setData({
            options: t
        }), this.getCouponList(t);
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {
        this.asPullDownRefresh();
    },
    asPullDownRefresh: function() {
        var o = this.data.options;
        this.getCouponList(o), t.dg.stopPullDownRefresh();
    },
    onReachBottom: function() {},
    getCouponList: function(o) {
        var n = this;
        t.requestUtil.get(t._DuoguanData.duoguan_host_api_url + "/index.php/addon/DuoguanCar/Api/getCouponList.html", o, function(t) {
            n.setData({
                couponlist: t
            });
        }), console.log(this.data);
    },
    getCoupon: function(o) {
        var n = this, a = {};
        a.id = o.currentTarget.dataset.id, a.type = o.currentTarget.dataset.type, t.requestUtil.post(t._DuoguanData.duoguan_host_api_url + "/index.php/addon/DuoguanCar/Api/getCoupon.html", a, function(t) {
            1 == t && n.setData({
                card_show: !1
            });
        });
    },
    showHide: function() {
        this.setData({
            card_show: !0
        });
    },
    seecard: function() {
        wx.navigateTo({
            url: "/pages/car/my-coupon/my-coupon"
        });
    }
});